package com.uni.dto;


import com.fasterxml.jackson.annotation.JsonFormat;
import com.uni.common.util.SystemConfig;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@NoArgsConstructor
@Data
public class ShopCommoditybgDTO {
    private Long id;
    private Long shopId;
    private String shopName;
    private Long commodityCategoryId;
    private String categoryName;
    private String name;
    private String coverUrl;
    private Integer price;
    private Integer specification;
    private Integer status;
    @JsonFormat(timezone = "GMT+8", pattern = "YYYY-MM-dd HH:mm:ss")
    private Date createTime;
    @JsonFormat(timezone = "GMT+8", pattern = "YYYY-MM-dd HH:mm:ss")
    private Date updateTime;

    public String getImageUrlAll() {
        if(coverUrl != null && !"".equals(coverUrl) && !coverUrl.startsWith("http")) {
            return SystemConfig.basePath + coverUrl;
        }
        return coverUrl;
    }

//    public String getImageUrlAll() {
//        if(StringUtils.isNotBlank(imageUrl) && imageUrl.startsWith("http")) {
//            return SystemConfig.basePath + imageUrl;
//        }
//        return imageUrl;
//    }
}
